package com.example.l2p_feedback;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;

public class View04_Homepage extends Activity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.view04_homepage);
		
		this.setTitle("Home");
	}
	private void clickActionHandler(int which) {
		Intent i; 
		switch (which) {
		case 1:
			i = new Intent(View04_Homepage.this, View01_OverallFeedback.class);
			startActivity(i);
			break;
		case 2:
			i = new Intent(View04_Homepage.this, View02_CourseSuggestion.class);
			startActivity(i);
			break;
		case 3:
			i = new Intent(View04_Homepage.this, View03_CourseQuestion.class);
			startActivity(i);
			break;
		case 5:
			i = new Intent(View04_Homepage.this, View05_Recommender.class);
			startActivity(i);
			break;
		case 8:
			i = new Intent(View04_Homepage.this, View08_ViewAll.class);
			startActivity(i);
		}
	}
	
	public void btnOverallFeedback(View v) {
		this.clickActionHandler(1);
	}
	public void btnCourses(View v) {
		this.clickActionHandler(3);
	}
	public void btnSuggestion(View v) {
		this.clickActionHandler(2);
	}
	public void btnAnalytics(View v) {
		this.clickActionHandler(5);
	}
	public void btnViewAllFeedback(View v) {
		this.clickActionHandler(8);
	}
}